<template>
  <view class="container">
    <view class="device"></view>
    <view class="top">
      <view style="display: flex; flex-direction: column; align-items: center; justify-content: center">
        <image :src="status == 1 ? '../../static/mine/refund.png' : '../../static/mine/applyingok.png'" style="width: 268rpx; height: 204rpx" mode=""></image>
        <view style="font-weight: 500; font-size: 28rpx; color: #222222; margin-top: 12rpx">{{ status == 1 ? '被驳回' : '申请通过' }}</view>
      </view>
      <view style="margin-top: 28rpx; margin-left: 26rpx">
        <text style="font-weight: 500; font-size: 28rpx; color: #222222">申请时间</text>
        <text style="font-weight: 500; font-size: 28rpx; color: #222222; padding-left: 26rpx">{{ info.applytime }}</text>
      </view>
      <view style="margin-top: 24rpx; margin-left: 26rpx">
        <text style="font-weight: 500; font-size: 28rpx; color: #222222">审批时间</text>
        <text style="font-weight: 500; font-size: 28rpx; color: #222222; padding-left: 26rpx">{{ info.shenhetime }}</text>
      </view>
      <view style="margin-top: 24rpx; margin-left: 26rpx">
        <text style="font-weight: 500; font-size: 28rpx; color: #222222">审批意见</text>
        <text style="font-weight: 500; font-size: 28rpx; color: #222222; padding-left: 26rpx">{{ info.auditing_reason }}</text>
      </view>
    </view>
    <view class="device"></view>
    <view class="content">
      <view class="item">
        <view class="title">绑定手机号</view>
        <view>{{ info.mobile }}</view>
      </view>
      <view class="item">
        <view class="title">工作地点</view>
        <view>{{ inof.province + info.citys }}</view>
      </view>
      <view class="item">
        <view class="title">机构信息来源</view>
        <view>{{ info.agency_name }}</view>
      </view>
      <view class="item">
        <view class="title">招募信息来源</view>
        <view>{{ info.sources_name }}</view>
      </view>
      <view class="item">
        <view class="title">获得驾照年份</view>
        <view>{{ info.license_age }}年</view>
      </view>
      <view class="item">
        <view class="title">紧急联系电话</view>
        <view>{{ info.urgent_mobile }}</view>
      </view>
      <!-- 身份证照片 -->
      <view style="font-weight: 500; font-size: 28rpx; color: #222222; margin-bottom: 16rpx">身份证照片</view>
      <view style="display: flex; align-items: center; justify-content: space-evenly">
        <image :src="imgurl + info.identity_just" style="width: 286rpx; height: 164rpx" mode=""></image>
        <image :src="imgurl + info.identity_back" style="width: 286rpx; height: 164rpx" mode=""></image>
      </view>
      <!-- 驾驶证照片 -->
      <view style="font-weight: 500; font-size: 28rpx; color: #222222; margin-bottom: 16rpx">身份证照片</view>
      <view style="display: flex; align-items: center; justify-content: space-evenly">
        <image :src="imgurl + info.license_just" style="width: 286rpx; height: 164rpx" mode=""></image>
        <image :src="imgurl + info.license_back" style="width: 286rpx; height: 164rpx" mode=""></image>
      </view>
    </view>
    <view class="reapply" v-if="status == 1" @click="gosjrz">重新申请</view>
  </view>
</template>

<script>
import dayjs from 'dayjs';
export default {
  data() {
    return {
      status: 1,
      driverid: '',
      info: {}
    };
  },
  onLoad(opt) {
    if (opt.driverid) {
      this.driverid = opt.driverid;
    }
    if (opt.type == 2) {
      this.status = 2;
    } else if (opt.type == 3) {
      this.status = 1;
    }
    this.getuserinfo();
  },
  methods: {
    // 获取个人信息
    getuserinfo() {
      this.http('/driver/mydriver', {
        driver_id: this.driverid
      }).then((res) => {
        console.log('个人信息', res);
        this.info = res.data;
        this.info.applytime = dayjs(this.info.createtime * 1000).format('YYYY-MM-DD HH-mm');
        this.info.shenhetime = dayjs(this.info.auditing_time * 1000).format('YYYY-MM-DD HH-mm');
      });
    },
    gosjrz() {
      uni.redirectTo({
        url: '/mine/sjrz/sjrz'
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.container {
  box-sizing: border-box;
  .device {
    box-sizing: border-box;
    width: 750rpx;
    height: 20rpx;
    background: #f8f8f8;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }
  .top {
    width: 100%;
    height: 488rpx;
  }
  .content {
    width: 100%;
    padding: 30rpx 28rpx;
    .item {
      display: flex;
      align-items: center;
      margin-bottom: 24rpx;
      .title {
        width: 200rpx;
        margin-right: 40rpx;
      }
    }
  }
  .reapply {
    box-sizing: border-box;
    width: 654rpx;
    height: 92rpx;
    text-align: center;
    line-height: 92rpx;
    font-weight: 500;
    font-size: 30rpx;
    color: #ffffff;
    background: #3483f6;
    margin-top: 48rpx;
    margin-left: 48rpx;
    border-radius: 20rpx 20rpx 20rpx 20rpx;
  }
}
</style>
